// 2013-9-11下午10:51:27  net.betou.trade.main.dao.role.AgencyRoleDao.java

package net.betou.trade.main.dao.role;

import java.util.List;

import net.betou.common.page.Pagination;
import net.betou.trade.entity.main.Role;

/**
 * 
 * @author 叶装装
 */
public interface AgencyRoleDao extends Dao{

	/**
	 * 获取分页数据
	 * @param level
	 * @param selfId
	 * @param searchProperty
	 * @param searchValue
	 * @param orderProperty
	 * @param orderDirection
	 * @param pageSize
	 * @param pageNo
	 * @return
	 */
	public Pagination getPage( Integer level, Integer selfId, String searchProperty, String searchValue, String orderProperty, String orderDirection, int pageSize, int pageNo );
	
	/**
	 * 获取分页数据
	 * @param level
	 * @param selfId
	 * @param searchProperty
	 * @param searchValue
	 * @param orderProperty
	 * @param orderDirection
	 * @param pageSize
	 * @param pageNo
	 * @param hideIdentity
	 * 						要隐藏的角色
	 * @return
	 */
	public Pagination getPage( Integer level, Integer selfId, String searchProperty, String searchValue, String orderProperty, String orderDirection, int pageSize, int pageNo, String hideIdentity );
	
	/**
	 * 查找自己的数据
	 * @param selfId
	 * @param id
	 * @return
	 */
	public Role findBySelf( Integer selfId, Integer id );
	
	/**
	 * 根据identity查询
	 * @param identity
	 * @return
	 */
	public Role findByIdentity( String identity );
	
	/**
	 * 查找当前用户的的List, 全部ROLE
	 * @param level
	 * @param selfId
	 * @return
	 */
	public List< Role > findList( Integer level, Integer selfId );
	
	public List< Role > findListNotDefault( Integer level, Integer selfId );
	
	/**
	 * 查找属于自己的默认
	 * @param selfId
	 * @param identity
	 * @return
	 */
	public Role findDefaultBySelf( Integer selfId, String identity );
	
	/**
	 * 查找需要初始化的角色
	 * @param allowRead
	 * @param allowInit
	 * @return
	 */
	public List< Role > findListByAllowInit( Boolean allowRead );
}
